<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Jialeo\LaravelSchemaExtend\Schema;

class AlertMobileToAppraiseTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('appraise', function (Blueprint $table) {
            $table->string('mobile',20)->default('')->comment('手机号')->after('dealTime');
            $table->string('tagDesc',255)->default('')->comment('评价标签文案')->after('mobile');
        });
        DB::statement("ALTER TABLE `appraise` MODIFY COLUMN `workOrderNo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '订单号';");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('appraise', function (Blueprint $table) {
            $table->dropColumn('mobile');
            $table->dropColumn('tagDesc');
        });
    }
}
